<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript">
        function draw() {
            const canvas = document.getElementById('canvas');
            const ctx = canvas.getContext('2d');

            let p = new Path2D('M10 10 h 80 v 80 h -80 Z');
            ctx.fill(p);
        }
    </script>
</head>
<body>
<body onload="draw()">
<canvas id="canvas" width="300px" height="300px"></canvas>
</body>
</body>
</html>